package com.alit.face.koala.app.data;

import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alit.face.koala.app.data.common.KoalaEmpLoyee;
import com.alit.face.koala.entity.KoalaEmpLoyeeEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 员工详情
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
public class EmployeeDetail extends KoalaEmpLoyee {
  private String id;
  // 组,和图片
  private List<String> groups;
  private List<PhotoData> photos;

  private String come_from;
  private int company_id;
  private long create_time;
  private int end_time;
  private String interviewee;
  private String interviewee_pinyin;
  private boolean password_reseted;
  private String pinyin;
  private int purpose;
  private int start_time;
  private boolean visit_notify;

  public EmployeeDetail(KoalaEmpLoyeeEntity entity) {
    setId(entity.getId());
    setAvatar(entity.getAvatar());
    setName(entity.getName());
    setJobNumber(entity.getJobNumber());
    setDepartment(entity.getDepartment());
    setTitle(entity.getTitle());
    setEmail(entity.getEmail());
    setPhone(entity.getPhone());
    setEntryDate(entity.getEntryDate());
    setBirthday(entity.getBirthday());
    setDescription(entity.getDescription());
    setRemark(entity.getRemark());
    setGender(entity.getGender());
    setSubjectType(entity.getSubjectType());
    this.groups = JSON.parseArray(entity.getGroupIds(), String.class);
  }
}